<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>IFlySpeechRecognizerDelegate Protocol Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">IFlyMSC </a></h1>
				<a id="developerHome" href="../index.html">iflytek</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">IFlySpeechRecognizerDelegate Protocol Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/onBeginOfSpeech">&nbsp;&nbsp;&nbsp;&nbsp;- onBeginOfSpeech</option>
	
	<option value="//api/name/onCancel">&nbsp;&nbsp;&nbsp;&nbsp;- onCancel</option>
	
	<option value="//api/name/onEndOfSpeech">&nbsp;&nbsp;&nbsp;&nbsp;- onEndOfSpeech</option>
	
	<option value="//api/name/onError:">&nbsp;&nbsp;&nbsp;&nbsp;- onError:</option>
	
	<option value="//api/name/onResults:isLast:">&nbsp;&nbsp;&nbsp;&nbsp;- onResults:isLast:</option>
	
	<option value="//api/name/onVolumeChanged:">&nbsp;&nbsp;&nbsp;&nbsp;- onVolumeChanged:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
</ul></li>









<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onBeginOfSpeech">onBeginOfSpeech</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onCancel">onCancel</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onEndOfSpeech">onEndOfSpeech</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onError:">onError:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onResults:isLast:">onResults:isLast:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/onVolumeChanged:">onVolumeChanged:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="IFlySpeechRecognizerDelegate Protocol Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">IFlySpeechRecognizerDelegate Protocol Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Conforms to</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">IFlySpeechRecognizerDelegate.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>语音识别协议</p>

<p>在使用语音识别时，需要实现这个协议中的方法.</p>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						
						

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/onError:">&ndash;&nbsp;onError:</a></code>
	</span>
	
	<span class="task-item-suffix">required method</span>
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/onResults:isLast:">&ndash;&nbsp;onResults:isLast:</a></code>
	</span>
	
	<span class="task-item-suffix">required method</span>
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/onVolumeChanged:">&ndash;&nbsp;onVolumeChanged:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/onBeginOfSpeech">&ndash;&nbsp;onBeginOfSpeech</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/onEndOfSpeech">&ndash;&nbsp;onEndOfSpeech</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/onCancel">&ndash;&nbsp;onCancel</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/onBeginOfSpeech" title="onBeginOfSpeech"></a>
	<h3 class="subsubtitle method-title">onBeginOfSpeech</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>开始录音回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onBeginOfSpeech</code></div>

    
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>开始录音回调</p>

<p>当调用了<code>startListening</code>函数之后，如果没有发生错误则会回调此函数。如果发生错误则回调onError:函数</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/onCancel" title="onCancel"></a>
	<h3 class="subsubtitle method-title">onCancel</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>取消识别回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onCancel</code></div>

    
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>取消识别回调</p>

<p>当调用了<code>cancel</code>函数之后，会回调此函数，在调用了cancel函数和回调onError之前会有一个短暂时间，您可以在此函数中实现对这段时间的界面显示。</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/onEndOfSpeech" title="onEndOfSpeech"></a>
	<h3 class="subsubtitle method-title">onEndOfSpeech</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>停止录音回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onEndOfSpeech</code></div>

    
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>停止录音回调</p>

<p>当调用了<code>stopListening</code>函数或者引擎内部自动检测到断点，如果没有发生错误则回调此函数。如果发生错误则回调onError:函数</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/onError:" title="onError:"></a>
	<h3 class="subsubtitle method-title">onError:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>识别结果回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onError:(IFlySpeechError *)<em>errorCode</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>errorCode</em></dt>
			<dd><p>错误描述类，</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>识别结果回调</p>

<p>在进行语音识别过程中的任何时刻都有可能回调此函数，你可以根据errorCode进行相应的处理，当errorCode没有错误时，表示此次会话正常结束；否则，表示此次会话有错误发生。特别的当调用<code>cancel</code>函数时，引擎不会自动结束，需要等到回调此函数，才表示此次会话结束。在没有回调此函数之前如果重新调用了<code>startListenging</code>函数则会报错误。</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/onResults:isLast:" title="onResults:isLast:"></a>
	<h3 class="subsubtitle method-title">onResults:isLast:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>识别结果回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onResults:(NSArray *)<em>results</em> isLast:(BOOL)<em>isLast</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>results</em></dt>
			<dd><p>-[out] 识别结果，NSArray的第一个元素为NSDictionary，NSDictionary的key为识别结果，value为置信度。</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>isLast</em></dt>
			<dd><p>-[out] 是否最后一个结果</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>识别结果回调</p>

<p>在识别过程中可能会多次回调此函数，你最好不要在此回调函数中进行界面的更改等操作，只需要将回调的结果保存起来。</p>

<p>使用results的示例如下：</p>

<pre><code>
- (void) onResults:(NSArray *) results{
    NSMutableString *result = [[NSMutableString alloc] init];
    NSDictionary *dic = [results objectAtIndex:0];
    for (NSString *key in dic)
    {
         //[result appendFormat:@"%@",key];//合并结果
    }
}
</code></pre>

	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/onVolumeChanged:" title="onVolumeChanged:"></a>
	<h3 class="subsubtitle method-title">onVolumeChanged:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>音量变化回调</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (void)onVolumeChanged:(int)<em>volume</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>volume</em></dt>
			<dd><p>-[out] 音量，范围从1-100</p></dd>
		</dl>
		
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>音量变化回调</p>

<p>在录音过程中，回调音频的音量。</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">IFlySpeechRecognizerDelegate.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 iflytek. All rights reserved. (Last updated: 2014-06-30)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>